<template>
<!-- 评价卡片 -->
  <div class="commentItem">
    <div class="left">
      <div class="top">
        <img class="headerImg" :src="commentObj.headImage" />
        <div class="userInfo">
          <div class="nickName">{{commentObj.userName}}</div>
          <Star :score="commentObj.score" />
        </div>
      </div>
      <div class="bottom">{{commentObj.content}}</div>
    </div>
    <div class="right">
      <img :src="commentObj.images.length > 0 ? commentObj.images[0].small : ''" />
      <div class="num">共{{commentObj.images.length}}张</div>
    </div>
  </div>
</template>

<script>
import Star from './star'
export default {
  name: 'commentItem',
  props: {
    commentObj: Object, // 单个评价
  },
  components: {
    Star
  },
  data () {
    return {

    }
  },
  methods: {

  },
  mounted() {
 
  }
}
</script>

<style scoped lang="scss">
.commentItem{
  margin: 0 25px 0 0;
  padding: 25px;
  box-shadow: 0 0 4px 2px rgba(0,0,0,.1);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: nowrap;
  font-size: 24px;
  &:first-of-type{
    margin: 0 25px;
  }
  .left{
    width: 360px;
    height: 208px;
    .top{
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      flex-wrap: nowrap;
      .headerImg{
        width: 50px;
        height: 50px;
        border-radius: 50%;
        margin-right: 16px;
      }
      .userInfo{
        .nickName{
          color: #666;
        }
      }
    }
    .bottom{
      color: #333;
      margin-top: 25px;
      line-height: normal;
      word-break: break-all;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 4;
      -webkit-box-orient: vertical;
    }
  }
  .right{
    position: relative;
    margin-left: 20px;
    width: 208px;
    height: 208px;
    img{
      width: 208px;
      height: 208px;
    }
    .num{
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 40px;
      line-height: 40px;
      text-align: center;
      background-color: #000;
      opacity: .3;
      color: white;
    }
  }
}
</style>

